package hu.mapro.gwtui.gxt.client.modelkeyprovider.entity;

import hu.mapro.gwtui.gxt.client.modelkeyprovider.DefaultModelKeyAdapter;

import com.google.common.base.Function;
import com.google.web.bindery.requestfactory.shared.EntityProxy;
import com.google.web.bindery.requestfactory.shared.EntityProxyId;

public class EntityModelKeyAdapter extends DefaultModelKeyAdapter<EntityProxy> {

	private static final Function<EntityProxy, EntityProxyId<EntityProxy>> PROXY_ID = new Function<EntityProxy, EntityProxyId<EntityProxy>>() {
		@SuppressWarnings("unchecked")
		@Override
		public EntityProxyId<EntityProxy> apply(EntityProxy input) {
			return (EntityProxyId<EntityProxy>) input.stableId();
		}
	};  
	
	public EntityModelKeyAdapter() {
		super(PROXY_ID);
	}

}
